package com.example.helloworld;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class ListView2 extends ListActivity {

	private String[] items = {"mike", "angel", "crow", "john", "ginnie", "sally", "cohen", "rice"};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setListAdapter(new ArrayAdapter<String>(
				this,
				android.R.layout.simple_list_item_1,
				items));
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		
		String text =	"postion : " + position + " " + items[position];
		Toast.makeText(this, text, Toast.LENGTH_LONG).show();
	}

}
